home *** CD-ROM | disk | FTP | other *** search
/ Gurewich OLE Controls for Visual Basic 4 / Gurewich OLE Controls for Visual Basic 4.iso / ocxprog / programs / ch08 / usa2.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-08-24  |  14.6 KB  |  431 lines

  1. VERSION 4.00
  2. Begin VB.Form Form1 
  3.    BackColor       =   &H00FFFFFF&
  4.    BorderStyle     =   1  'Fixed Single
  5.    Caption         =   "The USA2 Program"
  6.    ClientHeight    =   6105
  7.    ClientLeft      =   480
  8.    ClientTop       =   735
  9.    ClientWidth     =   7800
  10.    Height          =   6795
  11.    Icon            =   "USA2.frx":0000
  12.    Left            =   420
  13.    LinkTopic       =   "Form1"
  14.    MaxButton       =   0   'False
  15.    ScaleHeight     =   407
  16.    ScaleMode       =   3  'Pixel
  17.    ScaleWidth      =   520
  18.    Top             =   105
  19.    Width           =   7920
  20.    Begin TegousaLibCtl.TegoUSA TegoUSA1 
  21.       Height          =   5280
  22.       Left            =   0
  23.       TabIndex        =   8
  24.       Top             =   840
  25.       Width           =   7695
  26.       _version        =   65536
  27.       _extentx        =   13573
  28.       _extenty        =   9313
  29.       _stockprops     =   64
  30.    End
  31.    Begin VB.Label lblPopulation 
  32.       BackColor       =   &H00FFFFFF&
  33.       BorderStyle     =   1  'Fixed Single
  34.       BeginProperty Font 
  35.          name            =   "MS Sans Serif"
  36.          charset         =   0
  37.          weight          =   400
  38.          size            =   13.5
  39.          underline       =   0   'False
  40.          italic          =   0   'False
  41.          strikethrough   =   0   'False
  42.       EndProperty
  43.       Height          =   375
  44.       Left            =   6120
  45.       TabIndex        =   7
  46.       Top             =   360
  47.       Width           =   1575
  48.    End
  49.    Begin VB.Label lblYearOfStatehood 
  50.       BackColor       =   &H00FFFFFF&
  51.       BorderStyle     =   1  'Fixed Single
  52.       BeginProperty Font 
  53.          name            =   "MS Sans Serif"
  54.          charset         =   0
  55.          weight          =   400
  56.          size            =   13.5
  57.          underline       =   0   'False
  58.          italic          =   0   'False
  59.          strikethrough   =   0   'False
  60.       EndProperty
  61.       Height          =   375
  62.       Left            =   4560
  63.       TabIndex        =   6
  64.       Top             =   360
  65.       Width           =   1335
  66.    End
  67.    Begin VB.Label lblCapital 
  68.       BackColor       =   &H00FFFFFF&
  69.       BorderStyle     =   1  'Fixed Single
  70.       BeginProperty Font 
  71.          name            =   "MS Sans Serif"
  72.          charset         =   0
  73.          weight          =   400
  74.          size            =   13.5
  75.          underline       =   0   'False
  76.          italic          =   0   'False
  77.          strikethrough   =   0   'False
  78.       EndProperty
  79.       Height          =   375
  80.       Left            =   2520
  81.       TabIndex        =   5
  82.       Top             =   360
  83.       Width           =   1935
  84.    End
  85.    Begin VB.Label lblState 
  86.       BackColor       =   &H00FFFFFF&
  87.       BorderStyle     =   1  'Fixed Single
  88.       BeginProperty Font 
  89.          name            =   "MS Sans Serif"
  90.          charset         =   0
  91.          weight          =   400
  92.          size            =   13.5
  93.          underline       =   0   'False
  94.          italic          =   0   'False
  95.          strikethrough   =   0   'False
  96.       EndProperty
  97.       Height          =   375
  98.       Left            =   120
  99.       TabIndex        =   4
  100.       Top             =   360
  101.       Width           =   2295
  102.    End
  103.    Begin VB.Label Label4 
  104.       BackColor       =   &H00FFFFFF&
  105.       Caption         =   "Population (in Millions)"
  106.       Height          =   255
  107.       Left            =   6120
  108.       MousePointer    =   1  'Arrow
  109.       TabIndex        =   3
  110.       Top             =   120
  111.       Width           =   1575
  112.    End
  113.    Begin VB.Label Label3 
  114.       BackColor       =   &H00FFFFFF&
  115.       Caption         =   "Year of Statehood"
  116.       Height          =   255
  117.       Left            =   4560
  118.       MousePointer    =   1  'Arrow
  119.       TabIndex        =   2
  120.       Top             =   120
  121.       Width           =   1335
  122.    End
  123.    Begin VB.Label Label2 
  124.       BackColor       =   &H00FFFFFF&
  125.       Caption         =   "Capital"
  126.       Height          =   255
  127.       Left            =   2520
  128.       MousePointer    =   1  'Arrow
  129.       TabIndex        =   1
  130.       Top             =   120
  131.       Width           =   495
  132.    End
  133.    Begin VB.Label Label1 
  134.       BackColor       =   &H00FFFFFF&
  135.       Caption         =   "State"
  136.       Height          =   255
  137.       Left            =   120
  138.       TabIndex        =   0
  139.       Top             =   120
  140.       Width           =   495
  141.    End
  142.    Begin VB.Menu mnuFile 
  143.       Caption         =   "&File"
  144.       Begin VB.Menu mnuExit 
  145.          Caption         =   "E&xit"
  146.       End
  147.    End
  148.    Begin VB.Menu mnuHelp 
  149.       Caption         =   "&Help"
  150.       Begin VB.Menu mnuAbout 
  151.          Caption         =   "&About..."
  152.       End
  153.    End
  154. Attribute VB_Name = "Form1"
  155. Attribute VB_Creatable = False
  156. Attribute VB_Exposed = False
  157. ' All variables must be declared.
  158. Option Explicit
  159. ' Declare arrays for storage of information
  160. ' about the 50 states.
  161. Dim gCapital(50) As String
  162. Dim gYearOfStatehood(50) As String
  163. Dim gPopulation(50) As String
  164. Private Sub Form_Load()
  165.    ' Store information about State #0 (Border).
  166.    gCapital(0) = ""
  167.    gYearOfStatehood(0) = ""
  168.    gPopulation(0) = ""
  169.    ' Store information about State #1 (Alabama).
  170.    gCapital(1) = "Montgomery"
  171.    gYearOfStatehood(1) = "1819"
  172.    gPopulation(1) = "4.0"
  173.    ' Store information about State #2 (Alaska).
  174.    gCapital(2) = "Juneau"
  175.    gYearOfStatehood(2) = "1959"
  176.    gPopulation(2) = "0.6"
  177.    ' Store information about State #3 (Arizona).
  178.    gCapital(3) = "Phoenix"
  179.    gYearOfStatehood(3) = "1912"
  180.    gPopulation(3) = "3.7"
  181.    ' Store information about State #4 (Arkansas).
  182.    gCapital(4) = "Little Rock"
  183.    gYearOfStatehood(4) = "1836"
  184.    gPopulation(4) = "2.4"
  185.    ' Store information about State #5 (California).
  186.    gCapital(5) = "Sacramento"
  187.    gYearOfStatehood(5) = "1850"
  188.    gPopulation(5) = "29.8"
  189.    ' Store information about State #6 (Colorado).
  190.    gCapital(6) = "Denver"
  191.    gYearOfStatehood(6) = "1876"
  192.    gPopulation(6) = "3.3"
  193.    ' Store information about State #7 (Connecticut).
  194.    gCapital(7) = "Hartford"
  195.    gYearOfStatehood(7) = "1788"
  196.    gPopulation(7) = "3.3"
  197.    ' Store information about State #8 (Delaware).
  198.    gCapital(8) = "Dover"
  199.    gYearOfStatehood(8) = "1787"
  200.    gPopulation(8) = "0.7"
  201.    ' Store information about State #9 (Florida).
  202.    gCapital(9) = "Tallahassee"
  203.    gYearOfStatehood(9) = "1845"
  204.    gPopulation(9) = "12.9"
  205.    ' Store information about State #10 (Georgia).
  206.    gCapital(10) = "Atlanta"
  207.    gYearOfStatehood(10) = "1788"
  208.    gPopulation(10) = "6.5"
  209.    ' Store information about State #11 (Hawaii).
  210.    gCapital(11) = "Honolulu"
  211.    gYearOfStatehood(11) = "1959"
  212.    gPopulation(11) = "1.1"
  213.    ' Store information about State #12 (Idaho).
  214.    gCapital(12) = "Boise"
  215.    gYearOfStatehood(12) = "1890"
  216.    gPopulation(12) = "1.0"
  217.    ' Store information about State #13 (Illinois).
  218.    gCapital(13) = "Springfield"
  219.    gYearOfStatehood(13) = "1818"
  220.    gPopulation(13) = "11.4"
  221.    ' Store information about State #14 (Indiana).
  222.    gCapital(14) = "Indianapolis"
  223.    gYearOfStatehood(14) = "1816"
  224.    gPopulation(14) = "5.5"
  225.    ' Store information about State #15 (Iowa).
  226.    gCapital(15) = "Des Moines"
  227.    gYearOfStatehood(15) = "1846"
  228.    gPopulation(15) = "2.8"
  229.    ' Store information about State #16 (Kansas).
  230.    gCapital(16) = "Topeka"
  231.    gYearOfStatehood(16) = "1861"
  232.    gPopulation(16) = "2.5"
  233.    ' Store information about State #17 (Kentucky).
  234.    gCapital(17) = "Frankfort"
  235.    gYearOfStatehood(17) = "1792"
  236.    gPopulation(17) = "3.7"
  237.    ' Store information about State #18 (Louisiana).
  238.    gCapital(18) = "Baton Rouge"
  239.    gYearOfStatehood(18) = "1812"
  240.    gPopulation(18) = "4.2"
  241.    ' Store information about State #19 (Maine).
  242.    gCapital(19) = "Augusta"
  243.    gYearOfStatehood(19) = "1820"
  244.    gPopulation(19) = "1.2"
  245.    ' Store information about State #20 (Maryland).
  246.    gCapital(20) = "Annapolis"
  247.    gYearOfStatehood(20) = "1788"
  248.    gPopulation(20) = "4.8"
  249.    ' Store information about State #21 (Massachusetts).
  250.    gCapital(21) = "Boston"
  251.    gYearOfStatehood(21) = "1788"
  252.    gPopulation(21) = "6.0"
  253.    ' Store information about State #22 (Michigan).
  254.    gCapital(22) = "Lansing"
  255.    gYearOfStatehood(22) = "1837"
  256.    gPopulation(22) = "9.3"
  257.    ' Store information about State #23 (Minnesota).
  258.    gCapital(23) = "St. Paul"
  259.    gYearOfStatehood(23) = "1858"
  260.    gPopulation(23) = "4.4"
  261.    ' Store information about State #24 (Mississippi).
  262.    gCapital(24) = "Jackson"
  263.    gYearOfStatehood(24) = "1817"
  264.    gPopulation(24) = "2.6"
  265.    ' Store information about State #25 (Missouri).
  266.    gCapital(25) = "Jefferson City"
  267.    gYearOfStatehood(25) = "1821"
  268.    gPopulation(25) = "5.1"
  269.    ' Store information about State #26 (Montana).
  270.    gCapital(26) = "Helena"
  271.    gYearOfStatehood(26) = "1889"
  272.    gPopulation(26) = "0.8"
  273.    ' Store information about State #27 (Nebraska).
  274.    gCapital(27) = "Lincoln"
  275.    gYearOfStatehood(27) = "1867"
  276.    gPopulation(27) = "1.6"
  277.    ' Store information about State #28 (Nevada).
  278.    gCapital(28) = "Carson City"
  279.    gYearOfStatehood(28) = "1864"
  280.    gPopulation(28) = "1.2"
  281.    ' Store information about State #29 (New Hampshire).
  282.    gCapital(29) = "Concord"
  283.    gYearOfStatehood(29) = "1788"
  284.    gPopulation(29) = "1.1"
  285.    ' Store information about State #30 (New Jersey).
  286.    gCapital(30) = "Trenton"
  287.    gYearOfStatehood(30) = "1787"
  288.    gPopulation(30) = "7.7"
  289.    ' Store information about State #31 (New Mexico).
  290.    gCapital(31) = "Santa Fe"
  291.    gYearOfStatehood(31) = "1912"
  292.    gPopulation(31) = "1.5"
  293.    ' Store information about State #32 (New York).
  294.    gCapital(32) = "Albany"
  295.    gYearOfStatehood(32) = "1788"
  296.    gPopulation(32) = "18.0"
  297.    ' Store information about State #33 (North Carolina).
  298.    gCapital(33) = "Raleigh"
  299.    gYearOfStatehood(33) = "1789"
  300.    gPopulation(33) = "6.6"
  301.    ' Store information about State #34 (North Dakota).
  302.    gCapital(34) = "Bismarck"
  303.    gYearOfStatehood(34) = "1889"
  304.    gPopulation(34) = "0.6"
  305.    ' Store information about State #35 (Ohio).
  306.    gCapital(35) = "Columbus"
  307.    gYearOfStatehood(35) = "1803"
  308.    gPopulation(35) = "10.8"
  309.    ' Store information about State #36 (Oklahoma).
  310.    gCapital(36) = "Oklahoma City"
  311.    gYearOfStatehood(36) = "1907"
  312.    gPopulation(36) = "3.15"
  313.    ' Store information about State #37 (Oregon).
  314.    gCapital(37) = "Salem"
  315.    gYearOfStatehood(37) = "1859"
  316.    gPopulation(37) = "2.8"
  317.    ' Store information about State #38 (Pennsylvania).
  318.    gCapital(38) = "Harrisburg"
  319.    gYearOfStatehood(38) = "1787"
  320.    gPopulation(38) = "11.9"
  321.    ' Store information about State #39 (Rhode Island).
  322.    gCapital(39) = "Providence"
  323.    gYearOfStatehood(39) = "1790"
  324.    gPopulation(39) = "1.0"
  325.    ' Store information about State #40 (South Carolina).
  326.    gCapital(40) = "Columbia"
  327.    gYearOfStatehood(40) = "1788"
  328.    gPopulation(40) = "3.5"
  329.    ' Store information about State #41 (South Dakota).
  330.    gCapital(41) = "Pierre"
  331.    gYearOfStatehood(41) = "1889"
  332.    gPopulation(41) = "0.7"
  333.    ' Store information about State #42 (Tennessee).
  334.    gCapital(42) = "Nashville"
  335.    gYearOfStatehood(42) = "1796"
  336.    gPopulation(42) = "4.9"
  337.    ' Store information about State #43 (Texas).
  338.    gCapital(43) = "Austin"
  339.    gYearOfStatehood(43) = "1845"
  340.    gPopulation(43) = "17.0"
  341.    ' Store information about State #44 (Utah).
  342.    gCapital(44) = "Salt Lake City"
  343.    gYearOfStatehood(44) = "1896"
  344.    gPopulation(44) = "1.7"
  345.    ' Store information about State #45 (Vermont).
  346.    gCapital(45) = "Montpelier"
  347.    gYearOfStatehood(45) = "1791"
  348.    gPopulation(45) = "0.6"
  349.    ' Store information about State #46 (Virginia).
  350.    gCapital(46) = "Richmond"
  351.    gYearOfStatehood(46) = "1788"
  352.    gPopulation(46) = "6.2"
  353.    ' Store information about State #47 (Washington).
  354.    gCapital(47) = "Olympia"
  355.    gYearOfStatehood(47) = "1889"
  356.    gPopulation(47) = "4.9"
  357.    ' Store information about State #48 (West Virginia).
  358.    gCapital(48) = "Charleston"
  359.    gYearOfStatehood(48) = "1863"
  360.    gPopulation(48) = "1.8"
  361.    ' Store information about State #49 (Wisconsin).
  362.    gCapital(49) = "Madison"
  363.    gYearOfStatehood(49) = "1848"
  364.    gPopulation(49) = "4.9"
  365.    ' Store information about State #50 (Wyoming).
  366.    gCapital(50) = "Cheyenne"
  367.    gYearOfStatehood(50) = "1890"
  368.    gPopulation(50) = "0.5"
  369. End Sub
  370. Private Sub mnuAbout_Click()
  371.    Dim Title
  372.    Dim Msg
  373.    Dim CR
  374.    CR = Chr(13) + Chr(10)
  375.    ' The title of the About message box.
  376.    Title = "About the USA Program"
  377.    ' Prepare the message of the About message box.
  378.    Msg = "This program was written with Visual "
  379.    Msg = Msg + "Basic for Windows, using the "
  380.    Msg = Msg + "TegoSoft USA Map OCX control. "
  381.    Msg = Msg + CR + CR
  382.    Msg = Msg + "The TegoSoft USA Map OCX control "
  383.    Msg = Msg + "is part of the TegoSoft OCX Control "
  384.    Msg = Msg + "Kit - a collection of various OCX controls. "
  385.    Msg = Msg + CR + CR
  386.    Msg = Msg + "For more information about the "
  387.    Msg = Msg + "TegoSoft OCX Control Kit, contact TegoSoft "
  388.    Msg = Msg + "at:"
  389.    Msg = Msg + CR + CR
  390.    Msg = Msg + "TegoSoft Inc." + CR
  391.    Msg = Msg + "P.O. Box 389" + CR
  392.    Msg = Msg + "Bellmore, NY 11710"
  393.    Msg = Msg + CR + CR
  394.    Msg = Msg + "Phone: (516)783-4824"
  395.    ' Display the About message box.
  396.    MsgBox Msg, vbInformation, Title
  397. End Sub
  398. Private Sub mnuExit_Click()
  399.    ' Terminate the program.
  400.    Unload Me
  401. End Sub
  402. Private Sub TegoUSA1_ClickMap(ByVal StateId As Integer)
  403.   Dim Msg
  404.   Dim Title
  405.   Dim CR
  406.   CR = Chr(13) + Chr(10)
  407.   ' If the user did not click inside a state,
  408.   ' terminate this procedure.
  409.   If StateId = 0 Then Exit Sub
  410.   ' Prepare the title of the message box.
  411.   Title = "The USA2 Program"
  412.   ' Prepare the message of the message box.
  413.   Msg = "State: " + TegoUSA1.GetStateName(StateId)
  414.   Msg = Msg + CR
  415.   Msg = Msg + "Capital: " + gCapital(StateId)
  416.   Msg = Msg + CR
  417.   Msg = Msg + "Year of Statehood: " + gYearOfStatehood(StateId)
  418.   Msg = Msg + CR
  419.   Msg = Msg + "Population (in Millions): " + gPopulation(StateId)
  420.   ' Display the message box.
  421.   MsgBox Msg, vbOKOnly + vbInformation, Title
  422. End Sub
  423. Private Sub TegoUSA1_MouseMoveOnMap(ByVal StateId As Integer, ByVal x As Integer, ByVal y As Integer, ByVal Button As Integer)
  424.  ' Update the lblState, lblCapital, lblYearOfStatehood,
  425.  ' and lblPopulation labels.
  426.  lblState = TegoUSA1.GetStateName(StateId)
  427.  lblCapital = gCapital(StateId)
  428.  lblYearOfStatehood = gYearOfStatehood(StateId)
  429.  lblPopulation = gPopulation(StateId)
  430. End Sub
  431.